﻿@using Guan.CMS.Common.Framework
@using Guan.CMS.Web.ViewModels.ProductCategory
@model IEnumerable<ProductCategoryTree>
@{
    ViewBag.Title = "产品分类列表";
    ViewBag.SectionTitleImage = "ico-catalog.png";
}
<div class="section-header">
    <div class="title">
        @if (ViewBag.SectionTitleImage != null)
        {
            <img src="@Url.Content("~/Content/Images/Admin/" + ViewBag.SectionTitleImage)" alt="" />
        }
        @ViewBag.Title
    </div>
    <div class="options">
        @Html.ActionLink("新增","Edit","ProductCategory",null,new{@class="k-button"})
    </div>
</div>
<div class="section-body">
    @(Html.Kendo().Grid(Model)
          .Name("productCategory-grid")
          .Columns(columns =>
              {
                  columns.Bound(m => m.Id).Width(100);
                  columns.Bound(m => m.Name);
                  //columns.Bound(m => m.IsPublished).ClientTemplate("<img src='"+Url.Content("~/Content/Images/")+"active-#=IsPublished#"+".gif' />");
                  columns.Template(m => Html.ActionLink("编辑", "Edit", new {id = m.Id}))
                         .ClientTemplate("<a href=\"Edit/#= Id #\">编辑</a>")
                         .Centered().Width(50);
              }
          ).HtmlAttributes(new{style="height:460px;"})
          .Pageable(p => p.PageSizes(new[]{20,50,100})).Sortable().Scrollable().Filterable()
          .DataSource(dataSource => dataSource.Ajax().Read(read => read.Action("ListAjax", "ProductCategory")).PageSize(20))
          )
</div>